package com.mentaleye.dal.dao.mybatis;

import com.mentaleye.dal.dao.InterflowDao;
import com.mentaleye.dal.model.Interflow;
import com.mentaleye.dal.model.InterflowExample;
import com.mentaleye.dal.service.InterflowMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by Rock on 2017/5/12.
 */
@Repository
public class InterflowDaoImpl extends BaseDao implements InterflowDao {

    @Autowired private InterflowMapper interflowMapper;

    public boolean add(Interflow interflow) {
        return getResultByInt(interflowMapper.insertSelective(interflow));
    }

    public boolean update(Interflow interflow) {
        return getResultByInt(interflowMapper.updateByPrimaryKeySelective(interflow));
    }

    public boolean updateByExample(Interflow interflow, InterflowExample example) {
        return getResultByInt(interflowMapper.updateByExampleSelective(interflow, example));
    }

    public boolean delete(Integer interflowId) {
        return getResultByInt(interflowMapper.deleteByPrimaryKey(interflowId));
    }

    public boolean deleteByExample(InterflowExample example) {
        return getResultByInt(interflowMapper.deleteByExample(example));
    }

    public Interflow select(Integer interflowId) {
        return interflowMapper.selectByPrimaryKey(interflowId);
    }

    public List<Interflow> selectByExample(InterflowExample example) {
        return interflowMapper.selectByExample(example);
    }

    public List<Map<String, Object>> selectNotStudent(){
        return interflowMapper.selectNotStudent();
    }

    public List<Map<String, Object>> selectByMap(Map<String, Object> map){
        return interflowMapper.selectByMap(map);
    }
}
